package com.aaa.dem1104.d02;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.stream.Stream;

/**
 * @Author: whj
 * @Version 1.0
 * @Date: 2022/11/4  19:27
 */
public class Test {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list, "张无忌", "周芷若", "赵敏", "张强", "张三丰");
        //通过集合对象调用stream方法获取
        Stream<String> stream = list.stream();

        //通过Arrays数组工具类调用stream方法。
        String [] arr={"张三","李四","王五"};
        Stream<String> stream1 = Arrays.stream(arr);

        //通过Stream类中的方法获取Stream流对象
        Stream<String> stream2 = Stream.of("张三", "李四", "王五");
    }
}
